﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public partial class TwitterClient
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="language"></param>
        /// <returns></returns>
        public SuggestionCollection GetSuggestions(String language)
        {
            var cm = new GetSuggestionsCommand();
            cm.Lang = language;
            return this.GetSuggestions(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public SuggestionCollection GetSuggestions(GetSuggestionsCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Suggestions.SuggestionsUrl, command);
            return new SuggestionCollection(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="slug"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        public Suggestion GetSuggetstionsSlug(String slug, String language)
        {
            var cm = new GetSuggestionsSlugCommand();
            cm.Slug = slug;
            cm.Lang = language;
            return this.GetSuggetstionsSlug(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public Suggestion GetSuggetstionsSlug(GetSuggestionsSlugCommand command)
        {
            String url = String.Format(TwitterApiUrl.Version1_1.Suggestions.SuggestionsSlugUrl, command.Slug);
            String jsonText = this.GetResultText(url, command);
            return new Suggestion(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="slug"></param>
        /// <returns></returns>
        public UserCollection GetSuggestionUsers(String slug)
        {
            var cm = new GetSuggestionUsersCommand();
            cm.Slug = slug;
            return this.GetSuggestionUsers(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public UserCollection GetSuggestionUsers(GetSuggestionUsersCommand command)
        {
            String url = String.Format(TwitterApiUrl.Version1_1.Suggestions.SuggestionUsersUrl, command.Slug);
            String jsonText = this.GetResultText(url, command);
            return new UserCollection(jsonText);
        }
    }
}
